<?php
namespace app\common\validate;

use think\Validate;

class BannerValidate extends Validate
{
    protected $rule =   [
        'id'         => 'require|integer',
        'img|图片'   => 'require|image',
        'path|路径'  => 'require|in:banner,album',
    ];
    
    protected $scene = [
        /** api */
        'img'   => ['img', 'path'],

        /** admin */
        'list'  => ['page', 'limit'],
        'add'   => ['img'],
        'edit'  => ['id', 'img'],
        'show'  => ['id'],
    ];
}